﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using WebApiV2.Domain;
using WebApiV2.Interface;
using WebApiV2.Utils;

namespace WebApiV2.Api.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private readonly IRespository<Student> _Sturesponsitory;
        private readonly IRespository<Collge> _Colrespository;

        public WeatherForecastController(IRespository<Student> Sturespository, IRespository<Collge> Colresponsitory)
        {
            _Sturesponsitory = Sturespository;
            _Colrespository = Colresponsitory;
        }

        [HttpGet]
        public IEnumerable<WeatherForecast> Get()
        {
            throw new Exception("这里是一个故意犯错的地方！");

            //_Colrespository.Insert(new Collge
            //{
            //    CollgeName = "忍者学院",
            //    DeanName = "旗木卡卡西"
            //});

            //var list = _Colrespository.Table.ToList();
            //return JsonHelper.SerializeObject(list);
        }

    }
}
